﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ICuitControlBase.cs" company="">
//   
// </copyright>
// <summary>
//   The CuitControlBase interface.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace UITest.CUIT.CuitControls
{
    using System;
    using System.Drawing;

    using Microsoft.VisualStudio.TestTools.UITesting;

    /// <summary>
    ///     The CuitControlBase interface.
    /// </summary>
    public interface ICuitControlBase
    {
        #region Public Properties

        /// <summary>
        ///     Gets a value indicating whether enabled.
        /// </summary>
        bool Enabled { get; }

        /// <summary>
        ///     Gets a value indicating whether exists.
        /// </summary>
        bool Exists { get; }

        /// <summary>
        ///     Gets the parent.
        /// </summary>
        ICuitControlBase Parent { get; }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        ///     The click.
        /// </summary>
        void Click();

        /// <summary>
        /// The click.
        /// </summary>
        /// <param name="point">
        /// The point.
        /// </param>
        void Click(Point point);

        /// <summary>
        ///     The double click.
        /// </summary>
        void DoubleClick();

        /// <summary>
        ///     The find matching controls.
        /// </summary>
        /// <returns>
        ///     The <see cref="UITestControlCollection" />.
        /// </returns>
        UITestControlCollection FindMatchingControls();

        /// <summary>
        ///     The get base type.
        /// </summary>
        /// <returns>
        ///     The <see cref="Type" />.
        /// </returns>
        Type GetBaseType();

        /// <summary>
        ///     The get microsoft test control.
        /// </summary>
        /// <returns>
        ///     The <see cref="UITestControl" />.
        /// </returns>
        UITestControl GetMicrosoftTestControl();

        /// <summary>
        /// The get property.
        /// </summary>
        /// <param name="propertyName">
        /// The property name.
        /// </param>
        /// <returns>
        /// The <see cref="object"/>.
        /// </returns>
        object GetProperty(string propertyName);

        /// <summary>
        ///     The hover.
        /// </summary>
        void Hover();

        /// <summary>
        ///     The right click.
        /// </summary>
        void RightClick();

        /// <summary>
        /// The set browser window.
        /// </summary>
        /// <param name="testControl">
        /// The test control.
        /// </param>
        void SetBrowserWindow(UITestControl testControl);

        /// <summary>
        ///     The set focus.
        /// </summary>
        void SetFocus();

        /// <summary>
        ///     The wait for control enabled.
        /// </summary>
        /// <returns>
        ///     The <see cref="bool" />.
        /// </returns>
        bool WaitForControlEnabled();

        /// <summary>
        /// The wait for control enabled.
        /// </summary>
        /// <param name="millisecond">
        /// The millisecond.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        bool WaitForControlEnabled(int millisecond);

        /// <summary>
        ///     The wait for control exist.
        /// </summary>
        /// <returns>
        ///     The <see cref="bool" />.
        /// </returns>
        bool WaitForControlExist();

        /// <summary>
        /// The wait for control exist.
        /// </summary>
        /// <param name="millisecond">
        /// The millisecond.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        bool WaitForControlExist(int millisecond);

        /// <summary>
        ///     The wait for control ready.
        /// </summary>
        /// <returns>
        ///     The <see cref="bool" />.
        /// </returns>
        bool WaitForControlReady();

        /// <summary>
        /// The wait for control ready.
        /// </summary>
        /// <param name="millisecond">
        /// The millisecond.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        bool WaitForControlReady(int millisecond);

        /// <summary>
        /// The wrap.
        /// </summary>
        /// <param name="control">
        /// The control.
        /// </param>
        void Wrap(object control);

        /// <summary>
        /// The wrap ready.
        /// </summary>
        /// <param name="control">
        /// The control.
        /// </param>
        void WrapReady(object control);

        #endregion
    }
}